import request from '@/utils/request'

export const getNoticeById = (id) => {
  return request({
    url: '/system/notice/' + id,
    method: 'GET'
  })
}

export const getNoticeListPage = (page, size) => {
  return request({
    url: '/system/notice/list',
    method: 'GET',
    params: {
      page, size
    }
  })
}

export const searchNoticeListPage = (searchForm, page, size) => {
  return request({
    url: '/system/notice/search',
    method: 'POST',
    params: {
      page, size
    },
    data: searchForm
  })
}

export const addNotice = (noticeForm) => {
  return request({
    url: '/system/notice/add',
    method: 'POST',
    data: noticeForm
  })
}

export const editNotice = (noticeForm, id) => {
  return request({
    url: '/system/notice/edit/' + id,
    method: 'PUT',
    data: noticeForm
  })
}

export const deleteNotice = (id) => {
  return request({
    url: `/system/notice/delete/${id}`,
    method: 'DELETE'
  })
}
